﻿<?php include_once("db_config.php");?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="ysfl" >
    <link rel="icon" href="img/favicon.ico">
    <title><?php echo $name; echo $title;?></title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="js/jquery.min.js"></script>
    <script src="js/jquery.function.js"></script>
    <style type="text/css">
        body{
            background: url("./img/bg3.jpg") fixed center center no-repeat;
            text-align: center;
            width: auto;
            height: 500px;
        }
        h1{
            margin-top: 150px;
            color:rgba(224, 236, 193, 0.79);
        }
        h1 small{
            color:rgba(0, 245, 255, 0.79);
        }
        .connent{
            margin-top: 30%!important;
        }
        .connent-a{
            margin: 20px 0;
        }
    </style>
</head>
<body>
<h1>向日葵电脑内部服务器</h1>
    <div class="connent">
    <?php
                session_start();
                //检测是否登录，若没登录则转向登录界面
                if(!isset($_SESSION["userid"])){
                    echo '
                      <span class="index">
                        <a class="btn btn-danger" href="./reg.php">注册</a>
                        <a class="btn btn-success" href="./login.php">登陆</a>
                      </span>
                    ';
                }
                else {
                      echo '
                            <a href="#"><span style="color:rgb(6, 245, 0);">'. $_SESSION["level"].'</span>:<span style="color:rgb(0, 255, 245)">'. $_SESSION["username"].'</span></a>
                            <p class="connent-a">
                                <a class="btn btn-primary btn-xs" href="./admin">进入后台</a>
                                <span class="btn btn-danger btn-xs"  id="logout">退出登陆</span>
                            </p>
                      ';
                }
            ?>
    </div>
</body>
</html>